<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link href="<%=request.getContextPath() %>/css/site.css" rel="stylesheet">
<title>登陆</title>

</head>
<body>
	<%
	String msg = (String)request.getAttribute("msg");
	if(msg != null){
		out.print(msg);
	}
	%>
	<div class="center">

	<form id="frm" action="<%=request.getContextPath() %>/login" method="post">
		<table class="gridtable">
			<tr>
				<td width="40%">用户名：</td>
				<td>
					<input type="text" name="userId" id="userId" value="">
				</td>
			</tr>
			<tr>
				<td>密码</td>
				<td>
					<input type="password" name="password" autocomplete="off" id="password" value="">
				</td>
			</tr>
			<tr>
				<td>
					<input type="hidden" name="returnUrl" value='<%=request.getParameter("returnUrl") %>'>
				</td>
				<td>
					<input type="button" onclick="validate()" onclick="submit()" value="提交">
				</td>
			</tr>
		</table>
	</form>
	</div>
</body>
<script type="text/javascript">
	function validate(){
		var userId = document.getElementById("userId").value;
		var password = document.getElementById("password").value;
		//alert("userId=" + userId + "; pwd=" + password);
		if(userId == ""){
			alert("请输入用户名");
			return;
		}
		if(password == ""){
			alert("请输入密码");
			return;
		}
		document.getElementById("frm").submit();
	}
</script>
</html>